home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
games
/
astrw117.zip
/
ASTROBB.MST
< prev
next >
Wrap
Text File
|
1995-03-16
|
7KB
|
206 lines
'*************************************************************************
'* MSSetup Toolkit Sample 2
'*************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetct2.inc'
'''$INCLUDE 'msregdb.inc'
'''$INCLUDE 'msshared.inc'
''Dialog ID's
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 1000
CONST OPTIONS = 800
CONST APPHELP = 900
CONST FONTOPT = 1100
CONST CHECK = 2500
CONST CUSTINST = 6200
CONST TOOBIG = 6300
CONST BADPATH = 6400
CONST MULTILIST = 5200
CONST HELPPATH = 1300
CONST DATAPATH = 1500
CONST USERPATH = 1200
CONST DBPATH = 1700
CONST TEXTPATH = 2000
''Bitmap ID
CONST LOGO = 1
''File Types
CONST OPBDBCVT = 1
CONST OPLOCCVT = 2
CONST OPWINCVT = 3
CONST MAINI = 1
CONST HELPI = 2
CONST DATAI = 3
CONST USERI = 4
CONST SDB_I = 5
CONST LDB_I = 6
CONST XDB_I = 7
CONST TEXTI = 8
GLOBAL SINGMULT$ ''Single or Multiple Directory installation
GLOBAL FONTS$ ''TrueType or Adobe Fonts
GLOBAL MAIND$ ''Default destination directory.
'' Options List Symbol Names
''CustInst list symbol names
''Dialog list symbol names
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION ReplacePath (szOld$,szNew$,szDir$) AS STRING
DECLARE SUB InstallFont (szFont$, szName$)
DECLARE FUNCTION AddFontResource LIB "GDI.EXE" (szFont$) AS INTEGER
DECLARE FUNCTION RemoveFontResource LIB "GDI.EXE" (szFont$) AS INTEGER
DECLARE FUNCTION CreateScalableFontResource LIB "GDI.EXE" (hid%,szPath$, szFont$, szDir$ ) AS INTEGER
INIT:
CUIDLL$ = "mscuistf.dll" ''custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "ASTRO For Windows Setup"
IF GetWindowsMajorVersion() < 3 OR ( GetWindowsMajorVersion() = 3 AND GetWindowsMinorVersion() < 10 ) THEN
i% = DoMsgBox("ASTRO For Windows Requires Windows Version 3.1 or Greater!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
ENDIF
WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
WINDRIVE$= ucase$(WINDRIVE$)
MAIND$ = GetSymbolValue("STF_SRCDIR")
SINGMULT$="1"
''CustInst list symbols
FONTS$= "1"
FONTOPT:
SetSymbolValue "RadioDefault", FONTS$
FONTOPT1:
sz$ = UIStartDlg(CUIDLL$, FONTOPT, "FRadioDlgProc", APPHELP, HELPPROC$)
newopt$ = GetSymbolValue("ButtonChecked")
IF sz$ = "CONTINUE" THEN
UIPop 1
IF newopt$ <> FONTS$ THEN
FONTS$ = newopt$
END IF
newopt$ = ""
GOTO INSTALL
ELSEIF sz$ = "BACK" THEN
GOTO FONTOPT1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO FONTOPT1
ELSEIF sz$ = "EXIT" THEN
GOSUB QUIT
GOTO FONTOPT1
ELSE
UIPop 1
newopt$ = ""
GOTO INSTALL
END IF
INSTALL:
ini$ = MakePath(GetWindowsDir(), "ASTROW.INI")
CreateIniKeyValue ini$, "Directories", "Main", MAIND$, cmoOverwrite
CreateIniKeyValue ini$, "Directories", "Data", MAIND$, cmoOverwrite
CreateIniKeyValue ini$, "Directories", "DB", MAIND$, cmoOverwrite
CreateIniKeyValue ini$, "Directories", "Help", MAIND$, cmoOverwrite
CreateIniKeyValue ini$, "Directories", "User", MAIND$, cmoOverwrite
IF FONTS$ = "1" THEN
InstallFont "AstGly", "AstGlyphs (TrueType)"
ELSE
i% = DoMsgBox("Use ATM Control Panel to Install Fonts. Fonts Will Be found in your ASTRO Directory!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END IF
CreateProgmanGroup "ASTRO for Windows", GetWindowsDir()+"ASTROW.GRP", cmoNone
ShowProgmanGroup "ASTRO for Windows", 1, cmoNone
CreateProgmanItem "ASTRO for Windows", "ASTRO For Windows", MakePath(MAIND$,"ASTROW.EXE"), ",,,,"+MAIND$, cmoOverwrite
CreateProgmanItem "ASTRO for Windows", "ASTRO Help", "WINHELP.EXE " +MakePath(MAIND$,"ASTROW.HLP"), "", cmoOverwrite
CreateProgmanItem "ASTRO for Windows", "ASTRO Documentation", "WRITE.EXE " +MakePath(MAIND$,"ASTROW.WRI"), "", cmoOverwrite
CreateProgmanItem "ASTRO for Windows", "Commercial Use Agreement", "WRITE.EXE " +MakePath(MAIND$,"COMAGRE.WRI"), "", cmoOverwrite
CreateProgmanItem "ASTRO for Windows", "Registration Form", "WRITE.EXE " +MakePath(MAIND$,"REGISTER.WRI"), "", cmoOverwrite
CreateProgmanItem "ASTRO for Windows", "README File", "WRITE.EXE " +MakePath(MAIND$,"README.WRI"), "", cmoOverwrite
CreateProgmanItem "ASTRO for Windows", "VERSIONS File", "WRITE.EXE " +MakePath(MAIND$,"VERSIONS.WRI"), "", cmoOverwrite
CreateProgmanItem "ASTRO for Windows", "README.DOC File", "NOTEPAD.EXE " +MakePath(MAIND$,"README.DOC"), "", cmoOverwrite
QUIT:
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION
FUNCTION ReplacePath (szOld$,szNew$,szDir$) STATIC AS STRING
IF szDir$ <> szOld$ THEN
l% = LEN(szOld$)
x% = LEN(szNew$)
IF MID$(szOld$,l%-1) = "\" AND MID$(szNew$,x%-1) <> "\" THEN
p$ = MID$(szDir$,l%)
ELSEIF MID$(szOld$,l%-1) <> "\" AND MID$(szNew$,x%-1) = "\" THEN
p$ = MID$(szDir$,l%+2)
ELSE
p$ = MID$(szDir$,l%+1)
ENDIF
ReplacePath = szNew$ + p$
ELSE
ReplacePath = szNew$
END IF
END FUNCTION
SUB InstallFont (szFont$, szName$) STATIC
t$ = " "
p$ = MakePath(GetWindowsSysDir(), szFont$+".TTF" )
s$ = MakePath(MAIND$, szFont$+".TTF" )
CopyFile s$, p$, cmoNone, 0
IF GetExistingFOTFileForTTF( p$, t$, LEN(t$) ) > 0 THEN
p$ = MakePath(GetWindowsSysDir(), szFont$+".FOT" )
e% = RemoveFontResource(p$)
e% =CreateScalableFontResource(0,p$, szFont$+".TTF", GetWindowsSysDir() )
e% =AddFontResource(p$)
ELSE
p$ = MakePath(GetWindowsSysDir(), szFont$+".FOT" )
e% = CreateScalableFontResource(0,p$, szFont$+".TTF", GetWindowsSysDir() )
CreateIniKeyValue "WIN.INI", "fonts", szName$, szFont$+".FOT", cmoNone
e% = AddFontResource(p$)
END IF
END SUB